package com.rrd.hive.udf.phonebook;

import static com.rrd.hive.udf.sms.HiveUdfRegexTools.hiveUdfRegExpEx;

public class CvPhoneBookGetTags {

    static public String getInputTags(String input) {
        return ""
        + hiveUdfRegExpEx(input.toLowerCase(),"父母|爸|妈|爹|老娘|皇额娘|爷爷|奶奶|老公|公公|老公|老婆|老婆大人|婆娘|外婆|婆婆|丈夫|媳妇|妻子|儿子|女儿|dad|mom|姐|妹|伯")
        +hiveUdfRegExpEx(input,"办|贷|申请|借|中介|网贷|骗|套现|现金|代刷|口子|钱庄|地下|讨|债|催|提额|刷卡")
        +hiveUdfRegExpEx(input,"科室|实习|党支部|党办|办公室|接机|值班")
        +hiveUdfRegExpEx(input,"监理|消防|地板|总监|集团|打印|主席|电梯|轮胎|卡号|打印机|姥姥|永利|防|姥爷|股长|中行|国税|娣|宝马|参谋|支书|客户经理|中央|办证|媳妇儿|班车|别克|银行卡|农村信用|管理局|劳动局")
        +hiveUdfRegExpEx(input,"专线电话|老爷|山东|电费|兴业银行|金融|家政|中信银行|大华|合肥|组长|产中|国人|门口|温州|民政局|服装|小龙虾|美容院|驾照|对面|买车|行车|报警|刷卡|日本|公证|骚扰|资源|法律|刷卡机|人力|警察|王八蛋|分|房管|社会|车子|死|人事部|行政|工程部|联合|名片|交电|伙子|小伙子|信报|贴膜|商机|微商|粉丝")
        +hiveUdfRegExpEx(input,"赵|钱|孙|李|周|吴|郑|王|冯|陈|褚|卫|蒋|沈|韩|杨|朱|秦|尤|许|何|吕|施|张|孔|曹|严|华|金|魏|陶|姜|戚|谢|邹|喻|柏|水|窦|章|云|苏|潘|葛|奚|范|彭|郎|鲁|韦|昌|马|苗|凤|花|方|俞|任|袁|柳|酆|鲍|史|唐|费|廉|岑|薛|雷|贺|倪|汤|滕|殷|罗|毕|郝|邬|安|常|乐|于|时|傅|皮|卞|齐|康|伍|余|元|卜|顾|孟|平|黄|和|穆|萧|尹|姚|邵|湛|汪|祁|毛|禹|狄|米|明|臧|计|伏|成|戴|谈|宋|茅|庞|熊|纪|舒|屈|项|祝|董|梁|杜|阮|蓝|闵|席|季|麻|强|贾|路|娄|危|江|童|颜|郭|梅|盛|林|刁|锺|徐|邱|骆|高|夏|蔡|田|樊|胡|凌|霍|虞|万|支|柯|昝|管|卢|莫|经|房|裘|缪|干|解|应|宗|丁|宣|贲|邓|郁|单|杭|洪|包|诸|左|石|崔|吉|钮|龚|程|嵇|邢|滑|裴|陆|荣|翁|荀|羊|於|惠|甄|麴|家|封|芮|羿|储|靳|汲|邴|糜|松|井|段|富|巫|乌|焦|巴|弓|牧|隗|山|谷|车|侯|宓|蓬|全|郗|班|仰|秋|仲|伊|宫|宁|仇|栾|暴|甘|钭|历|戎|祖|武|符|刘|景|詹|束|龙|叶|幸|司|韶|郜|黎|蓟|溥|印|宿|白|怀|蒲|邰|从|鄂|索|咸|籍|赖|卓|蔺|屠|蒙|池|乔|阳|郁|胥|能|苍|双|闻|莘|党|翟|谭|贡|劳|逄|姬|申|扶|堵|冉|宰|郦|雍|却|璩|桑|桂|濮|牛|寿|通|边|扈|燕|冀|僪|浦|尚|农|温|别|庄|晏|柴|瞿|阎|充|慕|连|茹|习|宦|艾|鱼|容|向|古|易|慎|戈|廖|庾|终|暨|居|衡|步|都|耿|满|弘|匡|国|文|寇|广|禄|阙|东|欧|殳|沃|利|蔚|越|夔|隆|师|巩|厍|聂|晁|勾|敖|融|冷|訾|辛|阚|那|简|饶|空|曾|毋|沙|乜|养|鞠|须|丰|巢|关|蒯|相|查|后|荆|红|游|竺|权|逮|盍|益|桓|万俟|司马|上官|欧阳|夏侯|诸葛|闻人|东方|赫连|皇甫|尉迟|公羊|澹台|公冶|宗政|濮阳|淳于|单于|太叔|申屠|公孙|仲孙|轩辕|令狐|钟离|宇文|长孙|慕容|司徒|司空|召|有|舜|叶赫那拉|丛|岳|寸|贰|皇|侨|彤|竭|端|赫|实|甫|集|象|翠|狂|辟|典|良|函|芒|苦|其|京|中|夕|之|章佳|那拉|冠|宾|香|果|依尔根觉罗|依尔觉罗|萨嘛喇|赫舍里|额尔德特|萨克达|钮祜禄|他塔喇|喜塔腊|讷殷富察|叶赫那兰|库雅喇|瓜尔佳|舒穆禄|爱新觉罗|索绰络|纳喇|乌雅|范姜|碧鲁|张廖|张简|图门|太史|公叔|乌孙|完颜|马佳|佟佳|富察|费莫|蹇|称|诺|来|多|繁|戊|朴|回|毓|税|荤|靖|绪|愈|硕|牢|买|但|巧|枚|撒|泰|秘|亥|绍|以|壬|森|斋|释|奕|姒|朋|求|羽|用|占|真|穰|翦|闾|漆|贵|代|贯|旁|崇|栋|告|休|褒|谏|锐|皋|闳|在|歧|禾|示|是|委|钊|频|嬴|呼|大|威|昂|律|冒|保|系|抄|定|化|莱|校|么|抗|祢|綦|悟|宏|功|庚|务|敏|捷|拱|兆|丑|丙|畅|苟|随|类|卯|俟|友|答|乙|允|甲|留|尾|佼|玄|乘|裔|延|植|环|矫|赛|昔|侍|度|旷|遇|偶|前|由|咎|塞|敛|受|泷|袭|衅|圣|御|仆|镇|藩|邸|府|掌|首|员|焉|戏|可|智|尔|凭|悉|进|笃|厚|仁|业|肇|资|合|仍|九|衷|哀|刑|俎|仵|圭|夷|徭|蛮|汗|孛|乾|帖|罕|洛|淦|洋|邶|郸|郯|邗|邛|剑|虢|隋|蒿|茆|菅|苌|树|桐|锁|钟|机|盘|铎|斛|玉|线|针|箕|庹|绳|磨|蒉|瓮|弭|刀|疏|牵|浑|恽|势|世|仝|同|蚁|止|戢|睢|冼|种|涂|肖|己|泣|潜|卷|脱|谬|蹉|赧|浮|顿|说|次|错|念|夙|斯|完|丹|表|聊|源|姓|吾|寻|展|出|不|户|闭|才|无|书|学|愚|本|性|雪|霜|烟|寒|少|字|桥|板|斐|独|千|诗|嘉|扬|善|揭|祈|析|赤|紫|青|柔|刚|奇|拜|佛|陀|弥|阿|素|长|僧|隐|仙|隽|宇|祭|酒|淡|塔|琦|闪|始|星|南|天|接|波|碧|速|禚|腾|潮|镜|似|澄|潭|謇|纵|渠|奈|风|春|濯|沐|茂|英|兰|檀|藤|枝|检|生|折|登|驹|骑|貊|虎|肥|鹿|雀|野|禽|飞|节|宜|鲜|粟|栗|豆|帛|官|布|衣|藏|钞|银|门|盈|庆|喜|及|普|建|营|巨|望|希|道|载|声|漫|犁|力|贸|勤|革|改|兴|亓|睦|修|信|闽|北|守|坚|勇|汉|练|尉|士|旅|五|令|将|旗|军|行|奉|敬|恭|仪|堂|丘|义|礼|慈|孝|理|伦|卿|问|永|辉|位|让|尧|依|犹|介|承|市|所|苑|杞|剧|第|零|谌|招|续|达|忻|六|鄞|战|迟|候|宛|励|粘|萨|邝|覃|辜|初|楼|城|区|局|台|原|考|妫|纳|泉|清|德|卑|过|麦|曲|竹|百|福|言|第五|佟|年|笪|谯|哈|墨|南宫|赏|佴|佘|牟|商|西门|东门|左丘|梁丘|琴|后|况|亢|缑|帅|微生|羊舌|海|归|呼延|南门|东郭|百里|钦|鄢|汝|法|闫|楚|晋|谷梁|宰父|夹谷|拓跋|壤驷|乐正|漆雕|公西|巫马|端木|颛孙|子车|督|仉|司寇|亓官|鲜于|锺离|盖|逯|库|郏|逢|阴|薄|厉|稽|闾丘|公良|段干|开|光|操|瑞|眭|泥|运|摩|伟|铁|迮")
        +hiveUdfRegExpEx(input,"老豆|父|母|爸|妈|爹|娘|爷爷|奶奶|老公|公公|老公|老婆|婆娘|外婆|婆婆|丈夫|媳妇|妻子|夫人|儿子|女儿|dad|mom|姐|妹|哥|弟|妹|姨|姑|舅|叔|伯|婶|亲人|爱人|亲爱baby|honey|宝贝|宝宝|darling") //family
        +hiveUdfRegExpEx(input,"贷|借|骗|套现|现金|代刷|口子|提额|刷卡|催收|分期|债") //loan
        +hiveUdfRegExpEx(input,"贷款|借款|借钱|放贷|套现|提额|催收|分期|催款|高利贷") //loantag2
        +hiveUdfRegExpEx(input,"催收|催款") //collect 10
        +hiveUdfRegExpEx(input,"庄家|荷官|钱庄|赌|博彩|彩票|今彩|大馬彩|大马彩|威力彩|六合|乐透|樂透|澳門|星彩|雙贏彩|菠菜|博彩|博金|彩票|投注|Bet|bet|水位|盘口|赌场|娱乐城|银河娱乐|合彩|葡京|足彩|红单|体彩|外围|开奖|双色球|toto|TOTO|Toto|lottery|Lottery|lotto|Lotto|casino|Casino|老虎机|轮盘|百家乐|Slot|slot|雙色球|老虎機|輪盤|賭場|盤口|百家樂|赛马") //bet|bet2
        +hiveUdfRegExpEx(input,"海洛因|K粉|k粉|大麻|摇头丸|可卡因|冰毒|麻谷|麻果|开心水|HAPPY水")//drug
        +hiveUdfRegExpEx(input,"毒药|毒品") //drug2
        +hiveUdfRegExpEx(input,"娱乐|ktv|KTV|网吧|网管|游戏|台球|保龄球|桌游|剧本|密室|麻将|夜店")//game
        +hiveUdfRegExpEx(input,"私人会所|游艇|商会|私人银行|私行|保险柜|保险箱")//game2
        +hiveUdfRegExpEx(input,"高尔夫|滑雪|跳伞|潜水|马术|击剑")//sport
        +hiveUdfRegExpEx(input,"健身|运动|跑步|教练")//sport2
        +hiveUdfRegExpEx(input,"党支部|党办|党组织|党委|党建|党员|党校|党课|党史")//patrio
        +hiveUdfRegExpEx(input,"科室|办公室")//office
        +hiveUdfRegExpEx(input,"美国|英国|日本|澳大利亚|澳洲")//foreign 20
        +hiveUdfRegExpEx(input,"基督|伊斯兰|佛祖|如来佛|佛主|活佛|教堂|牧师|洗礼|礼拜|寺庙|少林寺|喇嘛|道观|道士|尼姑|萨满|出马仙|保家仙|仙人|供奉")//religion
        +hiveUdfRegExpEx(input,"留学|新东方|雅思|托福|GMAT|GRE|gmat|gre|新东方|英孚")//eng
        +hiveUdfRegExpEx(input,"中介")//agent
        +hiveUdfRegExpEx(input,"链家|中原|买房|租房|我爱我家|房天下|自如|安居客|贝壳|丽兹行|房多多|嗨住")//house
        +hiveUdfRegExpEx(input,"快递|骑士|骑手|送餐|配送|闪送")//transfer
        +hiveUdfRegExpEx(input,"保洁|清洁|打扫|家政|钟点工|保姆")//clean
        +getSexTag(input)
        +getDirtyTag(input)
        +hiveUdfRegExpEx(input,"旅行|签证|旅游|租车|酒店")//travel
        +hiveUdfRegExpEx(input,"理财|保险|投资")//finance 30
        +hiveUdfRegExpEx(input,"所得税|个税|公积金")//tax
        +hiveUdfRegExpEx(input,"买车|汽车|修车")//car
        +hiveUdfRegExpEx(input,"奔驰|宝马|奥迪|劳斯莱斯|宾利|迈巴赫|法拉利|兰博基尼|迈凯伦|阿斯顿|布加迪")//car2
        +hiveUdfRegExpEx(input,"高管|总监|部门长|执行官|总裁|老板|总经理|董事|主管|主任|科长|总|部长|行长")//manage
        +hiveUdfRegExpEx(input,"美容|整形|医美|整容|造型|发型|化妆")//beauty
        +hiveUdfRegExpEx(input,"医生|医院|外科|内科")//doctor
        +hiveUdfRegExpEx(input,"工程师")//tech
        +hiveUdfRegExpEx(input,"育儿|孕|幼儿园|学习|老师|班主任|小学|初中|高中|大学")//children
        +hiveUdfRegExpEx(input,"传销")//pyramid
        +hiveUdfRegExpEx(input,"法轮功|主神|灵灵教")//clut 40
        +getFamily2Tag(input)
        +getFamilyRelatedTag(input)
        +((hiveUdfRegExpEx(input,"贷") & hiveUdfRegExpEx(input, "办|申请|中介|经理|骗|信")) | hiveUdfRegExpEx(input, "网贷|套现|代刷|口子")) //intermediary
        +(hiveUdfRegExpEx(input,"赌") & hiveUdfRegExpEx(input,"博|场|球|钱|友")) //badcredit_gamble
        +(hiveUdfRegExpEx(input,"毒") & hiveUdfRegExpEx(input,"戒|吸|缉|品|舒|贩|犯|禁|反|鬼|介")) //badcredit_drug
        +(hiveUdfRegExpEx(input,"债") & hiveUdfRegExpEx(input,"讨|主|要")) //badcredit_debt
        +(hiveUdfRegExpEx(input,"催") & hiveUdfRegExpEx(input,"债|贷|款|钱|收")) //badcredit_dunning
        +hiveUdfRegExpEx(input,"赌") // du3
        +hiveUdfRegExpEx(input,"毒") // du2
        +hiveUdfRegExpEx(input,"债") // zhai4 50
        +hiveUdfRegExpEx(input,"催") // cui1
        +hiveUdfRegExpEx(input,"粉丝临时存储|赚法") // fakePb
        +hiveUdfRegExpEx(input,"惠今|嗨钱|分期|爱又米|钱站|借|贷|千百块|现金|有钱|差钱吗|给你花|提钱乐|付壹代|荷包|玖富|月光宝盒|积木盒子|平安普惠|闪电周转|缺钱么|任我花|省呗|闪钱包|还呗|闪银|先花花|小花钱包|马上金融|用钱宝|招联|秒下款|来钱宝") // debt peer
        +hiveUdfRegExpEx(input,"育儿|孕|幼儿园|学习|老师|班主任|小学|初中|高中"); //children(不包含大学)
    }

    private static int getSexTag(String name) {
        if(hiveUdfRegExpEx(name, "鸡头米") == 0) {
            return hiveUdfRegExpEx(name, "老鸨|鸡头|大茶壶|龟公|红灯区|妓院|学生妹|少妇|鸨母|卖淫|招妓|性奴");
        }
        return 0;
    }
    private static int getDirtyTag(String name) {
        if(hiveUdfRegExpEx(name, "泌尿") == 0) {
            return hiveUdfRegExpEx(name, "尿|屎|屁");
        }
        return 0;
    }

    private static int getFamily2Tag(String name) {
        if(hiveUdfRegExpEx(name, "公子") == 0) {
            return hiveUdfRegExpEx(name, "老豆|父|母|爸|妈|爹|娘|爷爷|奶奶|老公|公公|老公|老婆|婆娘|外婆|婆婆|丈夫|媳妇|妻子|夫人|儿子|女儿|dad|mom|姐|妹|哥|弟|妹|姨|姑|舅|叔|伯|婶|亲人|爱人|亲爱|baby|honey|宝贝|宝宝|darling");
        }
        return 0;
    }

    private static int getFamilyRelatedTag(String name) {
        if(hiveUdfRegExpEx(name, "公子") == 0) {
            return hiveUdfRegExpEx(name, "父亲|爸爸|爹爹|父皇|老爸|亲爹|母亲|母后|母上|妈妈|爸|妈|老公|老婆|丈夫|媳妇|妻子|夫人|儿子|女儿|dad|mom|爱人|daddy|mommy");
        }
        return 0;
    }

    public static void main(String[] args) {
        String input = "赌博";

        String inputTags = getInputTags(input);

        System.out.println(inputTags);
        System.out.println(inputTags.substring(43,44));
    }
}
